import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

import { HeroComponent } from './hero.component';
import { HeroDetailComponent } from './hero-detail.component';
import { HeroListComponent } from './hero-list.component';

const heroRoutes: Routes = [
  { path: '',
    component: HeroComponent,
    children: [
      { path: ':id', component: HeroDetailComponent },
      { path: '', component: HeroListComponent },
    ]
  }
];


@NgModule({
  imports: [RouterModule.forChild(heroRoutes)],
  exports: [RouterModule]
})
export class HeroRoutingModule {}

